//
//  MBFooterPageView.m
//  Meboo
//
//  Created by kyo on 2024/3/11.
//

#import "MBFooterPageView.h"

@interface MBFooterPageView ()

@end

@implementation MBFooterPageView

#pragma mark - Life Cycle
- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
//        [self setupUI];
    }
    return self;
}

#pragma mark - Public Metohd
- (void)setIndex:(NSInteger)index {
    _index = index;
    for (UIView *view in self.subviews) {
        if (view.tag >=100) {
            [view removeFromSuperview];
        }
    }
    for (int i = 0; i < self.totalNum; i++) {
        UIView *pageView = [UIView new];
        pageView.tag = 100+i;
        if (i == self.index) {
            pageView.backgroundColor = HEXS(@"FC898E");
        } else {
            pageView.backgroundColor = HEXS(@"D9D9D9");
        }
        pageView.layer.cornerRadius = MBHeightScale(1.5);
        [self addSubview:pageView];
        [pageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(MBHeightScale(6)*i);
            make.top.mas_equalTo(MBHeightScale(0));
            make.width.mas_equalTo(MBHeightScale(3));
            make.height.mas_equalTo(MBHeightScale(3));
        }];
    }
}

#pragma mark - UI

#pragma mark - Setter && Getter

@end
